@extends('admin::layouts.master')
@section('content')
    @component('components.tabs',['title' => "栏目管理"])
        @slot('nav')
            <li class="nav-item"><a class="nav-link" href="/article/category">栏目列表</a>
            </li>
            <li class="nav-item active"><a class="nav-link active" href="/article/category/{{$category['id']}}/edit">编辑栏目</a></li>
        @endslot
        @slot('body')
            <form action="/article/category/{{$category['id']}}" method="post">
                @csrf
                @method('PUT')
                <div class="panel-body">

                    <div class="form-group">
                        <label>栏目名称</label>
                        <input type="text" name="name" value="{{$category['name']}}"
                               class="form-control form-control-sm">
                    </div>
                    <div class="form-group">
                        <label>父级</label>
                        <select name="pid" class="form-control form-control-xs">
                            <option value="0">顶级栏目</option>
                            @foreach($categories as $cate)
                                <option
                                    value="{{$cate['id']}}"
                                    {{$cate['_selected'] ?  "selected" : ''}}
                                    {{$cate['_disabled'] ?  "disabled" : ''}}
                                >
                                    {!!$cate['_name'] !!}
                                </option>
                            @endforeach
                        </select>
                    </div>
                    <p class="text-left">
                        <button type="submit" class="btn btn-space btn-primary">提交</button>
                    </p>
                </div>
            </form>
        @endslot
    @endcomponent
@endsection
